<link type="text/css" href="/admins/css/menu.css" rel="stylesheet" />
<style>
    .numA{
        background: #db1717;
        color: #fff;
        padding: 0 5px;
        margin: 8px 0 0 3px;
        cursor: pointer;
        border-radius: 4px;
        position: relative;
        z-index: 100;
        line-height: 16px;
    }
</style>
<?php 
//    var_dump($this->topNavigation);exit;
    $html = "<ul>";
    $adminAction = $_SERVER["REQUEST_URI"];
    $arrAction = explode("/", $adminAction);
    $arr['27'] = Uuch_Util::getOutFin();
    if($this->topNavigation) {
//        var_dump($this->topNavigation);exit();
        foreach ($this->topNavigation as $NavigationVal)
        {
            $parentNavigation = $NavigationVal->getParentNavigationByParentIdTypeStatus(Application_Model_Navigation::Type_Top,Application_Model_Navigation::Status_Launch);
            if($arrAction[2] == $NavigationVal->Sign){
                $html .= ' <li class="adminon">';
            }else{
                $html .= ' <li>';
            }
            if(Uuch_Util::getRoleId()==100){
            }else{
                    if(count($parentNavigation) == 0 ){
                    $html .= '<div class="navt navt2" id="admintitle">';
                    $html .= '<a href="'.$NavigationVal->Url.'">' . $NavigationVal->Name . '</a>';
                    if($NavigationVal->IsNum == 1 && isset($arr["$NavigationVal->Id"]) && $arr["$NavigationVal->Id"] != 0 ){
                        $html .= '<span class="numA">'.$arr["$NavigationVal->Id"].'</span>'; 
                    }
                    $html .= '</div>';
                }  else {
                    $html .= '<div class="navt" id="admintitle">';
                    $html .= '<a href="'.$NavigationVal->Url.'">' . $NavigationVal->Name . '</a>';
                    if($NavigationVal->IsNum == 1 && isset($arr["$NavigationVal->Id"]) &&  $arr["$NavigationVal->Id"] != 0){
                        $html .= '<span class="numA">'.$arr["$NavigationVal->Id"].'</span>'; 
                    }
                    $html .= '<i class="ntes-nav-select-arr"></i></div><div class="navselect" style="display:none;"><div class="navselectbox"><dl>';
                    foreach ($parentNavigation as $parenNgVal) {
                        $html .= '<dd><a href="'.$parenNgVal->Url.'">' . $parenNgVal->Name . '</a></dd>';
                    }
                    $html .= '</dl></div></div>';
                }
            
            }

        }
    }
//    $adminAction = $_SERVER["REQUEST_URI"];
//    $arrAction = explode("/", $adminAction);
//    $navixml = simplexml_load_string(file_get_contents(APPLICATION_PATH . '/configs/menu.xml'));
//    
//	$request = Zend_Controller_Front::getInstance()->getRequest();
//	$module = $request->getModuleName();
//	$controller = $request->getControllerName();
//    
//	$action = $request->getActionName();
//	$moduleNode = $navixml->default;
//    
//	$html1 = '';
//        $html ="";
//        
//	foreach (get_object_vars($moduleNode->childNodes) as $key => $node) {
//		$nodeHtml = '';
//		foreach (get_object_vars($node->childNodes) as $subkey => $subnode) {
//			$url = "/admini/".$subnode['name']."/$subkey";
//			$nodeHtml .= '
//                <dd><a href="' . $url . '">' . $subnode['title'] . '</a></dd>';
//			
//		}
//                if($arrAction[2] == $key){
//                    $html1 .= '
//                        <li class="adminon">';
//                }else{
//                    $html1 .= '
//                        <li>';
//                }
//                if($nodeHtml != ''){
//                    $html1 .= '
//                        <div class="navt" id="admintitle" name="'.$key.'">';
//                }else{
//                    $html1 .= '<div class="navt navt2" id="admintitle" name="'.$key.'">';
//                }
//                $html1 .= '<a href="/admini/'.$key.'/'.$node['name'].'">' . $node['title'] . '</a>';
//		if ($nodeHtml != '') {
//                    $html1 .= '<i class="ntes-nav-select-arr"></i></div>
//          <div class="navselect" id="'.$key.'" style="display:none;"><div class="navselectbox">
//                        <dl>' . $nodeHtml . '</dl></div></div>';
//		}else{
//                    $html1 .= "</div>";
//                }
//		$html1 .= '
//       </li>';
//	}
//	if ($html1 != '') {
//		$html = '<ul>' . $html1 . '</ul>';
//	}
	echo $html;
?>

<script type="text/javascript">
    $(document).ready(function()
    {
        $('.adminnav li').hover(function(){
            $('.navselect',this).show();
        },function(){
            $('.navselect',this).hide()
        });
    });
</script>